<div class="wrapper wrapper-content" style="margin: 0;">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文件类型：</label>
                            <div class="col-sm-8">
                                <input id="type" name="type" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">URL地址：</label>
                            <div class="col-sm-8">
                                <input id="url" name="url" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文件属主：</label>
                            <div class="col-sm-8">
                                <input id="fileOwner" name="fileOwner" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">创建时间：</label>
                            <div class="col-sm-8">
                                <input id="createDate" name="createDate" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">上传人id：</label>
                            <div class="col-sm-8">
                                <input id="createUserId" name="createUserId" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">上传人名字：</label>
                            <div class="col-sm-8">
                                <input id="createUserName" name="createUserName" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文件原始名字：</label>
                            <div class="col-sm-8">
                                <input id="fileName" name="fileName" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文件大小：</label>
                            <div class="col-sm-8">
                                <input id="fileSize" name="fileSize" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">0有效，1无效：</label>
                            <div class="col-sm-8">
                                <input id="status" name="status" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">浏览文件地址：</label>
                            <div class="col-sm-8">
                                <input id="officeUrl" name="officeUrl" class="form-control" type="text">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        validateRule();
    });

    function save() {
        postAjax("/file/file/save", $('#signupForm').serialize(), function (data) {
            if (data.code == 0) {
                layer.msg(data.msg);
                reLoad();
                layer.close(current_index);
            } else {
                layer.alert(data.msg)
            }
        });
    }

    function validateRule() {
        var icon = "<i class='fa fa-times-circle'></i> ";
        $("#signupForm").validate({
            rules: {
                name: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: icon + "请输入姓名"
                }
            },
            submitHandler: function () {
                save();
            }
        })
    }
</script>